package com.study.english.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.english.pojo.vo.SysVideoUserLogVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.study.english.domain.SysVideoUserLog;
import com.study.english.service.ISysVideoUserLogService;
import com.study.english.mapper.SysVideoUserLogMapper;
import org.springframework.stereotype.Service;

/**
 * @author wf
 * @description 针对表【sys_video_user_log】的数据库操作Service实现
 * @createDate 2024-03-11 15:56:35
 */
@Service
public class SysVideoUserLogServiceImpl extends ServiceImpl<SysVideoUserLogMapper, SysVideoUserLog>
        implements ISysVideoUserLogService {

    @Autowired
    private ISysVideoUserLogService sysVideoUserLogService;


    @Override
    public void addSysVideoUserLog(SysVideoUserLogVo sysVideoUserLogVo) {
        SysVideoUserLog sysVideoUserLog = new SysVideoUserLog();
        BeanUtils.copyProperties(sysVideoUserLogVo, sysVideoUserLog);
        sysVideoUserLog.setIsDelete(0);
        sysVideoUserLog.setCreateTime(new Date());
        sysVideoUserLogService.save(sysVideoUserLog);
    }

    @Override
    public IPage<SysVideoUserLogVo> getSysVideoUserLogPageList(IPage<SysVideoUserLogVo> page, SysVideoUserLogVo sysVideoUserLogVo) {
        return this.baseMapper.getSysVideoUserLogPageList(page, sysVideoUserLogVo);
    }


    @Override
    public List<SysVideoUserLogVo> getSysVideoUserLogList(SysVideoUserLogVo sysVideoUserLogVo) {
        return this.baseMapper.getSysVideoUserLogList(sysVideoUserLogVo);

    }

    @Override
    public SysVideoUserLog getSysVideoUserLogById(String id) {
        return sysVideoUserLogService.getById(id);
    }


    @Override
    public void delSysVideoUserLog(String id) {
        sysVideoUserLogService.removeById(id);
    }


    @Override
    public void updateSysVideoUserLog(SysVideoUserLogVo sysVideoUserLogVo) {
        SysVideoUserLog sysVideoUserLog = new SysVideoUserLog();
        BeanUtils.copyProperties(sysVideoUserLogVo, sysVideoUserLog);
        sysVideoUserLogService.updateById(sysVideoUserLog);
    }
}




